# Stack the SCF data from 1989 - 2022

vars <- c("WGT","AGE","RACE","ASSET","INCOME") # variables of interest
SCF89_22 <- data.frame() # initialize data.frame

years <- seq(from = 1989,to = 2022, by = 3)

for (y in years){
  scf <- read_csv(paste("data/SCFP",as.character(y),".csv",sep = ""))
  SCF89_22 <- rbind(SCF89_22,data.frame(ID = 1:nrow(scf), YEAR = rep(y,nrow(scf)), scf[,vars]))
}

SCF89_22[,-1]
rm(scf)